#include <bits/stdc++.h>
using namespace std;
using ll = long long;
void solve()
{
    ll n, s;
    cin >> n >> s;
    ll s1 = s, s2 = s;
    vector<ll> p(n + 1);
    for (ll i = 1; i <= n; i++)
    {
        cin >> p[i];
        ll now = p[i];
        if (now >= s1 - 1)
        {
            s1 = ceil((1.0 * (s1 + now)) / 2);
        }
    }
    cout << s1 << endl;
}
int main()
{
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    ll T = 1;
    cin >> T;
    while (T--)
    {
        // cout << ceil(5.0 / 2);
        solve();
    }
    return 0;
}